import React from "react";
import '../assets/css/item.css'
function Item (props){
  const {id,name,done,update,del} = props
return (
  <li>
    <span className="itemName">
      <input type="checkbox" checked={done} onChange={()=>update(id)}/> 
      <span className={done?"del":""}>{name}</span></span>
    <span>{done?'已完成':'未完成'}</span>
    <button onClick={()=>del(id)}>删除</button>
  </li>
)
}
export default Item